package org.jsola.contract.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.contract.constant.AppendixType;
import org.jsola.contract.constant.FileType;
import org.jsola.contract.constant.SignMethod;
import org.jsola.contract.constant.SignOrder;
import org.jsola.contract.constant.SignType;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;

import javax.validation.constraints.NotNull;

import static org.jsola.contract.example.CategoryExample.E_APPENDIX_TYPE;
import static org.jsola.contract.example.CategoryExample.E_DESCRIPTION;
import static org.jsola.contract.example.CategoryExample.E_ENTERPRISE_SEAL_ID;
import static org.jsola.contract.example.CategoryExample.E_EXPIRE_DAYS;
import static org.jsola.contract.example.CategoryExample.E_FILE_TYPE;
import static org.jsola.contract.example.CategoryExample.E_GROUP_ID;
import static org.jsola.contract.example.CategoryExample.E_ISSUE;
import static org.jsola.contract.example.CategoryExample.E_IS_OPEN;
import static org.jsola.contract.example.CategoryExample.E_IS_SITE_UPDATE;
import static org.jsola.contract.example.CategoryExample.E_NAME;
import static org.jsola.contract.example.CategoryExample.E_REMARK;
import static org.jsola.contract.example.CategoryExample.E_SIGN_ORDER;
import static org.jsola.contract.example.CategoryExample.E_SIGN_SEAL_TYPE;
import static org.jsola.contract.example.CategoryExample.E_SIGN_TYPE;
import static org.jsola.contract.example.CategoryExample.E_SOURCE_ID;
import static org.jsola.contract.example.CategoryExample.E_SUBJECT_ID;
import static org.jsola.contract.example.CategoryExample.M_APPENDIX_TYPE_ENUM_NOT_MATCH;
import static org.jsola.contract.example.CategoryExample.M_APPENDIX_TYPE_MAX;
import static org.jsola.contract.example.CategoryExample.M_DESCRIPTION_MAX;
import static org.jsola.contract.example.CategoryExample.M_FILE_TYPE_ENUM_NOT_MATCH;
import static org.jsola.contract.example.CategoryExample.M_FILE_TYPE_MAX;
import static org.jsola.contract.example.CategoryExample.M_GROUP_ID_NOT_NULL;
import static org.jsola.contract.example.CategoryExample.M_NAME_MAX;
import static org.jsola.contract.example.CategoryExample.M_NAME_NOT_NULL;
import static org.jsola.contract.example.CategoryExample.M_REMARK_MAX;
import static org.jsola.contract.example.CategoryExample.M_SIGN_ORDER_ENUM_NOT_MATCH;
import static org.jsola.contract.example.CategoryExample.M_SIGN_ORDER_MAX;
import static org.jsola.contract.example.CategoryExample.M_SIGN_SEAL_TYPE_ENUM_NOT_MATCH;
import static org.jsola.contract.example.CategoryExample.M_SIGN_TYPE_ENUM_NOT_MATCH;
import static org.jsola.contract.example.CategoryExample.M_SIGN_TYPE_MAX;
import static org.jsola.contract.example.CategoryExample.M_SOURCE_ID_MAX;
import static org.jsola.contract.example.CategoryExample.M_SUBJECT_ID_MAX;
import static org.jsola.contract.example.CategoryExample.N_APPENDIX_TYPE;
import static org.jsola.contract.example.CategoryExample.N_DESCRIPTION;
import static org.jsola.contract.example.CategoryExample.N_ENTERPRISE_SEAL_ID;
import static org.jsola.contract.example.CategoryExample.N_EXPIRE_DAYS;
import static org.jsola.contract.example.CategoryExample.N_FILE_TYPE;
import static org.jsola.contract.example.CategoryExample.N_GROUP_ID;
import static org.jsola.contract.example.CategoryExample.N_ISSUE;
import static org.jsola.contract.example.CategoryExample.N_IS_OPEN;
import static org.jsola.contract.example.CategoryExample.N_IS_SITE_UPDATE;
import static org.jsola.contract.example.CategoryExample.N_NAME;
import static org.jsola.contract.example.CategoryExample.N_REMARK;
import static org.jsola.contract.example.CategoryExample.N_SIGN_ORDER;
import static org.jsola.contract.example.CategoryExample.N_SIGN_SEAL_TYPE;
import static org.jsola.contract.example.CategoryExample.N_SIGN_TYPE;
import static org.jsola.contract.example.CategoryExample.N_SOURCE_ID;
import static org.jsola.contract.example.CategoryExample.N_SUBJECT_ID;

/**
 * 合同类型
 *
 * @author JanusMix
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【合同类型】的参数")
@Data
public class CategoryAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_IS_OPEN, example = E_IS_OPEN)
    private Boolean isOpen;

    @ApiModelProperty(notes = N_IS_SITE_UPDATE, example = E_IS_SITE_UPDATE)
    private Boolean isSiteUpdate;

    @ApiModelProperty(notes = N_GROUP_ID, example = E_GROUP_ID, required = true)
    @NotNull(message = M_GROUP_ID_NOT_NULL)
    private Long groupId;

    @ApiModelProperty(notes = N_SOURCE_ID, example = E_SOURCE_ID)
    @Length(max = 32, message = M_SOURCE_ID_MAX)
    private String sourceId;

    @ApiModelProperty(notes = N_SUBJECT_ID, example = E_SUBJECT_ID)
    @Length(max = 32, message = M_SUBJECT_ID_MAX)
    private String subjectId;

    @ApiModelProperty(notes = N_NAME, example = E_NAME, required = true)
    @NotNull(message = M_NAME_NOT_NULL)
    @Length(max = 50, message = "name长度不能超过50")
    private String name;

    @ApiModelProperty(notes = N_DESCRIPTION, example = E_DESCRIPTION)
    @Length(max = 1000, message = M_DESCRIPTION_MAX)
    private String description;

    @ApiModelProperty(notes = N_REMARK, example = E_REMARK)
    @Length(max = 500, message = M_REMARK_MAX)
    private String remark;

    @ApiModelProperty(notes = N_ENTERPRISE_SEAL_ID, example = E_ENTERPRISE_SEAL_ID)
    private Long enterpriseSealId;

    @ApiModelProperty(notes = N_SIGN_TYPE, example = E_SIGN_TYPE, allowableValues = SignMethod.VALUES_STR)
    @Length(max = 50, message = M_SIGN_TYPE_MAX)
    @Const(constClass = SignMethod.class, message = M_SIGN_TYPE_ENUM_NOT_MATCH)
    private String signType;

    @ApiModelProperty(notes = N_SIGN_SEAL_TYPE, example = E_SIGN_SEAL_TYPE, allowableValues = SignType.VALUES_STR)
    @Const(constClass = SignType.class, message = M_SIGN_SEAL_TYPE_ENUM_NOT_MATCH)
    private Integer signSealType;

    @ApiModelProperty(notes = N_EXPIRE_DAYS, example = E_EXPIRE_DAYS)
    private Integer expireDays;

    @ApiModelProperty(notes = N_SIGN_ORDER, example = E_SIGN_ORDER, allowableValues = SignOrder.VALUES_STR)
    @Length(max = 50, message = M_SIGN_ORDER_MAX)
    @Const(constClass = SignOrder.class, message = M_SIGN_ORDER_ENUM_NOT_MATCH)
    private String signOrder;

    @ApiModelProperty(notes = N_FILE_TYPE, example = E_FILE_TYPE, allowableValues = FileType.VALUES_STR)
    @Length(max = 50, message = M_FILE_TYPE_MAX)
    @Const(constClass = FileType.class, message = M_FILE_TYPE_ENUM_NOT_MATCH)
    private String fileType;

    @ApiModelProperty(notes = N_APPENDIX_TYPE, example = E_APPENDIX_TYPE, allowableValues = AppendixType.VALUES_STR)
    @Length(max = 50, message = M_APPENDIX_TYPE_MAX)
    @Const(constClass = AppendixType.class, message = M_APPENDIX_TYPE_ENUM_NOT_MATCH)
    private String appendixType;

    @ApiModelProperty(notes = N_ISSUE, example = E_ISSUE)
    private Boolean issue;


}

